package com.peng.dian.service;

import com.peng.dian.mapper.EmployeeMapper;
import com.peng.dian.pojo.Employee1;
import com.peng.dian.pojo.Employee2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeeServiceImpl implements EmployeeService {
    @Autowired
    EmployeeMapper employeeMapper;
    @Override
    public List<Employee1> queryEmployee() {
        List<Employee1> employee1s = employeeMapper.queryEmployee();
        return employee1s;
    }

    @Override
    public Employee1 queryEmployeeById(int id) {
        Employee1 employee1 = employeeMapper.queryEmployeeById(id);
        return employee1;
    }

    @Override
    public int addEmployee(Employee1 employee1) {
        int i = employeeMapper.addEmployee(employee1);
        return i;
    }

    @Override
    public int updateEmployee(Employee1 employee1) {
        int i = employeeMapper.updateEmployee(employee1);
        return i;
    }

    @Override
    public int deleteEmployee(int id) {
        int i = employeeMapper.deleteEmployee(id);
        return i;
    }

    @Override
    public List<Employee2> queryEmployee2() {
        List<Employee2> employee2s = employeeMapper.queryEmployee2();
        return employee2s;
    }

    @Override
    public Employee2 queryEmployeeName(String name) {
        return employeeMapper.queryEmployeeName(name);
    }
}
